Jump to content
Sign in to follow this  
bigringantics

Why Won't My Task Start?

Recommended Posts

Hi folks, I'm new to Arma 3 scripting and I'm having a problem getting a createSimpleTask command to work in a script. The relevant part of the code is below:

constantinou switchMove "Acts_Kore_IdleNoWeapon_out";
sleep 1.3;
[1,1.5,false,false] call BIS_fnc_cinemaBorder;

obj2 = kelly createSimpleTask ["task2"];
obj2 setSimpleTaskDescription ["Go to Bravo Troop's bay and meet Mako Team.","Meet Mako Team",""];
obj2 setSimpleTaskDestination (getMarkerPos "obj2Marker");
obj2 setTaskState "Assigned";

The player's unit is named kelly. Everything works until the end of the BIS_fnc_cinemaBorder line, but after the border recedes the task isn't created. Can anybody see what the problem is?

Share this post


Link to post
Share on other sites

Try this format: (Write kelly instead of player)

task_1 = player createSimpleTask ["TASKNAME"];

task_1 setSimpleTaskDescription ["TASK DESCRIPTION","Example Task","WHAT WILL BE DISPLAYED ON THE MAP"];

task_1 setSimpleTaskDestination (getMarkerPos "task_1");

task_1 setTaskState "Assigned";

player setCurrentTask task_1;

credits to

Share this post


Link to post
Share on other sites

Thanks Gfresco, I've got the task in-game now. The only other problem I'm having is that I don't get the notification in the top center of the screen like I do when I create a task from a trigger, any idea how to get that too?

Share this post


Link to post
Share on other sites

I would recommend using Bis_fnc_taskCreate, much simpler, it should also cause the hint to pop up.

https://community.bistudio.com/wiki/BIS_fnc_taskCreate

Example from a mission of mine.

[JNA_Player,"JNA_TSK2",["Fully clear buildings to the right","Clear buildings",""],[1879,2747,0],"Assigned",0] call Bis_fnc_taskCreate;

I think that would work for you.

[Kelly,"Task_1",["DESCRIPTION","TITLE","DISPLAYED ON MAP"],(getMarkerPos "task_1"),"Assigned",0] call Bis_fnc_taskCreate;

Share this post


Link to post
Share on other sites

When you say 'create task from a trigger' are you using the modules for that?

I think the notifications only happen if you use the new BIS task functions, as in BIS_fnc_taskCreate rather than the old style tasks. You can always make this happen yourself by using BIS_fnc_showNotification, see HERE for setting them up, or look at CFGNotifications in the config viewer to find the name of the default ones to use.

Share this post


Link to post
Share on other sites
Thanks Gfresco, I've got the task in-game now. The only other problem I'm having is that I don't get the notification in the top center of the screen like I do when I create a task from a trigger, any idea how to get that too?

Uhh, not really. I'm pretty new to scripting tasks, but what you could do as a stop-gap is put in the trigger activiation: Hint "New objective/task assigned", and if you want to take it a little further you could use the sidechat feature to simulate some text/dialogue in the trigger like -- PAPABEAR=[West,"HQ"]; PAPABEAR SideChat "Stand-by for updated assignment".

Jona33 method might be better, he sounds like he knows more than me, but I thought i'd float out my method as well.

Share this post


Link to post
Share on other sites

BIS_fnc_taskCreate was scrapped a while ago. all task functions were merged into one: BIS_fnc_setTask.

["TASK NAME",SIDE TO EXECUTE ON,["Description", "WHAT IS DISPLAYED ON MAP", "WHAT IS DISPLAYED ON SCREEN"],POSITION,"STATE",PRIORITY,showNotification?,JIP Compatible?] call BIS_fnc_setTask;

Share this post


Link to post
Share on other sites
BIS_fnc_taskCreate was scrapped a while ago. all task functions were merged into one: BIS_fnc_setTask.

["TASK NAME",SIDE TO EXECUTE ON,["Description", "WHAT IS DISPLAYED ON MAP", "WHAT IS DISPLAYED ON SCREEN"],POSITION,"STATE",PRIORITY,showNotification?,JIP Compatible?] call BIS_fnc_setTask;

BIS_fnc_taskCreate was not scapped at all. its actually what BIS_fnc_setTask calls on in its function.

Share this post


Link to post
Share on other sites

Dont know what makes you say it was scrapped. There is nothing on the WIKI that states this. Both functions have always existed taskCreate eventually calling setTask. Even the BIS task modules call taskCreate.

Share this post


Link to post
Share on other sites

For the BIS_fnc_taskCreate function, does CfgTaskDescription go in the description.ext or Config.cpp?

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  

×