Jump to content
Sign in to follow this  
calo_mir

Task created twice?

Recommended Posts

The following is called from a trigger with execVM at the start of the

mission. There's no other code in the mission:

E0_mission_done = false;

E0_mission_task = player createSimpleTask ["kill_soldier"];
E0_mission_task setSimpleTaskDescription ["Kill soldier", "Kill the Russian!", "Danger"];
E0_mission_task setTaskState "Created";
[nil, nil, E0_mission_task, "Created"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

E0_death_handler = {
 _killed = _this select 0;
 _killer = _this select 1;

 hint format ['%1 killed by %2', _killed, _killer];
 E0_mission_done = true;
};

soldier_0 addEventHandler ["killed", E0_death_handler];

waitUntil {E0_mission_done};

E0_mission_task setTaskState "Succeeded";
[nil, nil, E0_mission_task, "Succeeded"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

sleep 10;

endMission "END1";

Two identical tasks are created and the task hints are displayed twice. When the task is successfully completed, task completed hints are displayed for both.

What's going on?

Share this post


Link to post
Share on other sites

E0_mission_task setTaskState "Created";
[nil, nil, E0_mission_task, "Created"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

Is the line:

[nil, nil, E0_mission_task, "Created"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

needed in this instance? I don't use that line when I set up tasks. Did you try to remove it?

EDIT: Actually my mistake. I do use it but I use "Assigned" instead of "Created".

Here's a sample from my mission:

tskEvidence1 = player createSimpleTask ["Talk to Commander"];

tskEvidence1 setSimpleTaskDescription ["Go get the marching orders from the Commander.", "Talk to Commander", "Talk to Commander"];

tskEvidence1 setSimpleTaskDestination (getMarkerPos "Mrk1");

player setCurrentTask tskEvidence1;

[objNull, ObjNull, tskEvidence1, "ASSIGNED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

Maybe try it with out:

E0_mission_task setTaskState "Created";

It seems those two lines do the same thing, I think.

I hope this helps.

Edited by Manzilla

Share this post


Link to post
Share on other sites

Hm, doesn't seem to be it.

Even with the two lines commented out:

E0_mission_task = player createSimpleTask ["kill_soldier"];
E0_mission_task setSimpleTaskDescription ["Kill soldier", "Kill the Russian!", "Danger"];
// E0_mission_task setTaskState "Created";
// [nil, nil, E0_mission_task, "Created"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

I don't get any task hints shown (as expected) but still, two tasks are created:

fMV9np.png

---------- Post added at 01:45 PM ---------- Previous post was at 01:41 PM ----------

Heh, commenting out every single line except:

E0_mission_task = player createSimpleTask ["kill_soldier"];

... still causes the creation of two identical tasks.

Looks like a bug to me.

Same thing happens with your code.

Share this post


Link to post
Share on other sites

Hmmm. Very odd indeed. Do you have a briefing.sqf set up as well? If so, is the task created there as well.

Share this post


Link to post
Share on other sites

There's myself, a russian soldier and a trigger on the map. The trigger condition is set to 'true' and it executes:

nul = [] execVM "init.sqf";

init.sqf is the code I posted earlier.

Nothing else going on. I'm as confused as anyone...

---------- Post added at 02:39 PM ---------- Previous post was at 02:37 PM ----------

OH DEAR.

"init.sqf" isn't a file that's treated specially by ArmA, is it?

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  

×