_grpSelect = enemyGroupTypes call BIS_fnc_selectRandom;
StartTask = ["StartTask", true, ["We have reports of pirate activity all over the Afrenian side of Duala. Informants are telling command it's for something major. We need your team to sweep the marked areas and collect any intel you find.","Gather Intel","Sweep Area"], [], "ASSIGNED", 1, true, true, "", true] call BIS_fnc_setTask;
if (intelCount >= 3) then
{
{
_resgrp1 = [getMarkerPos _x, EAST, (_grpSelect)] call BIS_fnc_spawngroup;
_holder = (units _resgrp1) call bis_fnc_selectRandom;
_mkrname = format ["mkr_%1", _x];
_taskmkr = createMarker [_mkrname, getPos _holder];
_taskmkr setMarkerShape "ELLIPSE";
_taskmkr setMarkerType "Empty";
_taskmkr setMarkerSize [50,50];
_taskmkr setMarkerColor "ColorOPFOR";
_taskmkr setMarkerBrush "FDiagonal";
_taskmkr setMarkerText "Known Enemy Activity";
_taskmkr setMarkerAlpha 1;
TaskMarkers pushBack _taskmkr;
_holder addEventHandler ["killed",
{
_unit = (_this select 0);
_dropPos = [_unit, 1, (random 360)] call bis_fnc_relpos;
_droppedIntel = "EvKobalt" createVehicle _dropPos;
_droppedIntel allowDamage false;
_droppedIntel enableSimulation false;
player sideChat "I think that one dropped something.";
PickUp = [["PickUp","StartTask"], true, ["One of the contacts dropped something. Pick it up.","Gather Intel","Pick Up"], [getPos _droppedIntel], "ASSIGNED", 1, true, true, "", true] call BIS_fnc_setTask;
_droppedIntel addAction ["Gather Intelligence",
{
_del = _this select 0;
deleteVehicle _del;
gatheredIntel = gatheredIntel + 1;
if (gatheredIntel < intelCount) then
{
player sideChat "SPEARHEAD to PHALANX. We have neutralized an insurgent team and gathered some documents, over.";
sleep 3;
PHALANX sideChat "Excellent work, SPEARHEAD. Proceed to locate the rest of the files. PHALANX out.";
[PickUp, "Succeeded"] call BIS_fnc_taskSetState;
} else
{
if (gatheredIntel >= intelCount) then
{
player sideChat "SPEARHEAD to PHALANX. We have collected all the files. Sending details now. How copy? Over.";
sleep 5;
PHALANX sideChat "Roger, SPEARHEAD. After going over the documents, we've discovered a Molatian officer we need you to arrest.";
sleep 5;
PHALANX sideChat "Do not kill the officer. Repeat DO NOT KILL THE MOLATIAN OFFICER. We need to interrogate him to find out what he may know.";
sleep 5;
PHALANX sideChat "How copy, SPEARHEAD? Over.";
sleep 5;
player sideChat "Copy, PHALANX. Capture, not kill, the HVT. SPEARHEAD out.";
[PickUp, "Succeeded"] call BIS_fnc_taskSetState;
[StartTask, "Succeeded"] call BIS_fnc_taskSetState;
{
deleteMarker _x;
} forEach TaskMarkers;
Task2 = ["HVT", true, ["Capture the officer for interrogation in Bolabongo. Beforewarned, Captain, the Molatians are swarming all over the city, and the target is without doubt accompanied by guards.", "Arrest HVTs", "Capture the Officer"], [getMarkerPos "mkrHvt"], "ASSIGNED", 1, true, true, "", true] call BIS_fnc_setTask;
taskmk2 = createMarker ["AreaMarker2", getMarkerPos "mkrHVT"];
taskmk2 setMarkerShape "ELLIPSE";
taskmk2 setMarkerType "Empty";
taskmk2 setMarkerBrush "FDiagonal";
taskmk2 setMarkerColor "ColorOPFOR";
taskmk2 setMarkerSize [500,500];
taskmk2 setMarkerAlpha 1;
taskmk2 setMarkerText "Bolabongo - HOSTILE CITY";
_nil = execVM "midgame.sqf";
};
};
}];
}];
} forEach selectedStart;
} else
{
_resgrp1 = [getMarkerPos selectedStart, EAST, (_grpSelect)] call BIS_fnc_spawngroup;
_holder = (units _resgrp1) call bis_fnc_selectRandom;
task1 = createMarker ["AreaMarker", getPos _holder];
task1 setMarkerShape "ELLIPSE";
task1 setMarkerType "Empty";
task1 setMarkerSize [50,50];
task1 setMarkerColor "ColorOPFOR";
task1 setMarkerBrush "FDiagonal";
task1 setMarkerText "Known Enemy Activity";
task1 setMarkerAlpha 1;
_holder addEventHandler ["killed",
{
_unit = (_this select 0);
_dropPos = [_unit, 1, (random 360)] call bis_fnc_relpos;
_droppedIntel = "EvKobalt" createVehicle _dropPos;
_droppedIntel allowDamage false;
_droppedIntel enableSimulation false;
player sideChat "I think that one dropped something.";
PickUp = [["PickUp","StartTask"], true, ["One of the contacts dropped something. Pick it up.","Gather Intel","Pick Up"], [getPos _droppedIntel], "ASSIGNED", 1, true, true, "", true] call BIS_fnc_setTask;
_droppedIntel addAction ["Gather Intelligence",
{
_del = _this select 0;
deleteVehicle _del;
gatheredIntel = gatheredIntel + 1;
if (gatheredIntel < intelCount) then
{
player sideChat "SPEARHEAD to PHALANX. We have neutralized an insurgent team and gathered some documents, over.";
sleep 3;
PHALANX sideChat "Excellent work, SPEARHEAD. Proceed to locate the rest of the files. PHALANX out.";
[PickUp, "Succeeded"] call BIS_fnc_taskSetState;
} else
{
if (gatheredIntel >= intelCount) then
{
player sideChat "SPEARHEAD to PHALANX. We have collected all the files. Sending details now. How copy? Over.";
sleep 5;
PHALANX sideChat "Roger, SPEARHEAD. After going over the documents, we've discovered a Molatian officer we need you to arrest.";
sleep 5;
PHALANX sideChat "Do not kill the officer. Repeat DO NOT KILL THE MOLATIAN OFFICER. We need to interrogate him to find out what he may know.";
sleep 5;
PHALANX sideChat "How copy, SPEARHEAD? Over.";
sleep 5;
player sideChat "Copy, PHALANX. Capture, not kill, the HVT. SPEARHEAD out.";
[PickUp, "Succeeded"] call BIS_fnc_taskSetState;
deleteMarker task1;
Task2 = ["HVT", true, ["Capture the officer for interrogation in Bolabongo. Beforewarned, Captain, the Molatians are swarming all over the city, and the target is without doubt accompanied by guards.", "Arrest HVTs", "Capture the Officer"], [getMarkerPos "mkrHvt"], "ASSIGNED", 1, true, true, "", true] call BIS_fnc_setTask;
taskmk2 = createMarker ["AreaMarker2", getMarkerPos "mkrHVT"];
taskmk2 setMarkerShape "ELLIPSE";
taskmk2 setMarkerType "Empty";
taskmk2 setMarkerBrush "FDiagonal";
taskmk2 setMarkerColor "ColorOPFOR";
taskmk2 setMarkerSize [500,500];
taskmk2 setMarkerAlpha 1;
taskmk2 setMarkerText "Bolabongo - HOSTILE CITY";
_nil = execVM "midgame.sqf";
};
};
}];
}];
};
Here is the script with the trouble tasks.
The goal is to create 1 parent, then 1-25 children, marking the destination. When you kill a unit that drops an intel item, the task of the unit you killed is completed and a new one (pick up the actual intel item) is added, and once you pick up the intel, that objective is completed then removed.